<?php


namespace app\controller\Web;

use app\util\ResponseTrait;
use support\Request;
use app\service\Web\NewsCateService;

use hg\apidoc\annotation as Apidoc;

/**
 * @Apidoc\Title("新闻分类")
 */
class NewsCateController
{
    use ResponseTrait;

    /**
     * @Apidoc\Url("/web/newsCate/getAll")
     * @Apidoc\Title("全部")
     * @Apidoc\Method("GET")
     * @Apidoc\Returned(type="array", require=false, default="[]",desc="新闻分类",table="news_cate")
     */
    public function getAll(Request $request){
        try {
            $where = [];

            $where['is_show'] = 10;

            $data = NewsCateService::getAll($where);

            return $this->success($data);
        } catch (Throwable $e) {
            return $this->fail($e);
        }
    }

}